﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Audio;

namespace PROJECT_BOMBER.BLL
{
    public class FactoryPiece
    {
        public enum TypePiece
        {
            PieceOr,
            PieceArgent,
            PieceBronze
        }

        private AnimationDefinition _or;
        private AnimationDefinition _argent;
        private AnimationDefinition _bronze;
        //SoundEffect sonPiece;

        public FactoryPiece(AnimationDefinition or, AnimationDefinition argent, AnimationDefinition bronze)
        {
            _or = or;
            _argent = argent;
            _bronze = bronze;
        }

        public Piece Create(TypePiece type, int x, int y)
        {
            Piece piece = null;
            switch (type)
            {
                case TypePiece.PieceOr:
                    piece = new Piece(x, y, 10);
                    piece.AddAnimation("default", new AnimationSprite(Globals.Game, _or));
                    break;
                case TypePiece.PieceArgent:
                    piece = new Piece(x, y, 5);
                    piece.AddAnimation("default", new AnimationSprite(Globals.Game, _argent));
                    break;
                case TypePiece.PieceBronze:
                    piece = new Piece(x, y, 1);
                    piece.AddAnimation("default", new AnimationSprite(Globals.Game, _bronze));
                    break;
            }

            return piece;
        }


    }
}
